﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Util.Expand
{
    /// <summary>
    /// 字符串扩展
    /// </summary>
    public static class StringExpand
    {
        /// <summary>
        /// 转int32
        /// </summary>
        /// <param name="parameter"></param>
        /// <returns></returns>
        public static int ToInt(this string parameter)
        {
            return Convert.ToInt32(parameter);
        }
        /// <summary>
        /// 转DateTime
        /// </summary>
        /// <param name="parameter"></param>
        /// <returns></returns>
        public static DateTime ToDateTime(this string parameter)
        {
            return Convert.ToDateTime(parameter);
        }
        /// <summary>
        /// 转Time
        /// </summary>
        /// <param name="parameter"></param>
        /// <returns></returns>
        public static string ToTime(this string parameter)
        {
            return Convert.ToDateTime(parameter).ToString("HH:MM:ss");
        }
    }
}
